package com.qianfeng.pojo;


import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Date;

public class SysHumiture implements Serializable, CheckEmptyInterface{

  private long id;
  private String deviceId;
  private double humidity;
  private double temperature;
  private Date uploadTime;
  @Override
  public boolean isEmpty(CheckType checkType) {
    switch (checkType) {
      case ADD:
        return !StringUtils.hasText(deviceId) || ObjectUtils.isEmpty(humidity) || ObjectUtils.isEmpty(temperature);
    }
    return CheckEmptyInterface.super.isEmpty(checkType);
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }


  public String getDeviceId() {
    return deviceId;
  }

  public void setDeviceId(String deviceId) {
    this.deviceId = deviceId;
  }


  public double getHumidity() {
    return humidity;
  }

  public void setHumidity(double humidity) {
    this.humidity = humidity;
  }


  public double getTemperature() {
    return temperature;
  }

  public void setTemperature(double temperature) {
    this.temperature = temperature;
  }


  public Date getUploadTime() {
    return uploadTime;
  }

  public void setUploadTime(Date uploadTime) {
    this.uploadTime = uploadTime;
  }

}
